<?php
namespace App\Repositories;

use DB;
use App\Interfaces\RefundGoodsOperationRecordService;
use App\Models\RefundGoodsOperationRecord;


class RefundGoodsOperationRecordRepository  implements RefundGoodsOperationRecordService{


    /*
     * 创建收货服务单操作记录
     * @param string $refund_sn             服务单编号
     * @param tinyint $operation_status     售后服务操作状态
     * @param datetime $operation_time      操作时间
     * @param int $user_id                  执行操作的用户id
     *
     * @date:2016/02/18
     * @author:Leen
     */
    public function createRefundGoods($refund_sn, $operation_status, $operation_time, $user_id){

        return RefundGoodsOperationRecord::insert([
            'refund_sn'=>$refund_sn,
            'operation_status'=>$operation_status,
            'operation_time'=>$operation_time,
            'user_id'=>$user_id

        ]);

    }//end func createReturnGoods()


    /**
     * 根据服务单号获取服务单操作记录
     *
     * @param string $refund_sn         服务单编号
     *
     * @date:2016/02/18
     * @author Leen
     */
    public function getByRefundSn($refund_sn){

        return RefundGoodsOperationRecord::where('refund_sn', $refund_sn)->paginate(10);

    }//end func getByRefundSn()


}